package jmine.tec.hydra.diagnostician;

import static bancosys.tec.rtm.diagnostician.AbstractDiagnostician.JMX_DEFAULT_CACHE_DURATION_IN_SECONDS;
import static bancosys.tec.rtm.diagnostician.AbstractDiagnostician.JMX_NAMESPACE;
import static jmine.tec.hydra.diagnostician.HydraOutgoingTimeDiagnostician.NAME;
import jmine.tec.hydra.domain.enumx.HydraRequestType;

import org.springframework.jmx.export.annotation.ManagedResource;

import bancosys.tec.persist.controller.TransactionalController;

/**
 * Diagnosticador que guarda metricas de tempo de envio de mensagens do hydra.
 * 
 * @author Marcio Ribeiro (mmr)
 * @created Dec 2, 2011
 */
@ManagedResource(description = NAME, objectName = JMX_NAMESPACE + ":name=hydraOutgoingTime", currencyTimeLimit = JMX_DEFAULT_CACHE_DURATION_IN_SECONDS)
public class HydraOutgoingTimeDiagnostician extends HydraRequestTimeDiagnostician {

    public static final String NAME = "Tempo mensagens de saída do Hydra";

    /**
     * Construtor.
     * 
     * @param controller controller.
     */
    public HydraOutgoingTimeDiagnostician(TransactionalController controller) {
        super(controller);
    }

    /**
     * @return saída.
     */
    @Override
    protected HydraRequestType getRequestType() {
        return HydraRequestType.SEND;
    }

    /**
     * @return NAME.
     */
    public String getName() {
        return NAME;
    }
}
